<?php
/**
 * [商网通 System] Copyright swtshop.cn
 * QQ: 1170787711
 * Author: gj.name
 * This is NOT a freeware
*/  class member extends module {
function __construct(){ 
	parent::__construct(); 
} 
function index(){ 
	$this->m = isset($_GET['m'])?trim($_GET['m']):'index'; 
	$this->a = isset($_GET['a'])?trim($_GET['a']):'index'; 
	if($this->m != 'index'){ 
		$shop_module_arr = array('shop', 'goods', 'goods_order', 'goods_act', 'freight', 'distribute', 'bill', 'express', 'album', 'design');
		if(cfg('shop_alone') == '1'){ 
			if(in_array($this->m, $shop_module_arr)){ 
				$this->check_shop(); 
			}else{ 
				if(!empty($_SESSION['shop']['spid'])){ 
					echo '<script>location.href="member.php?m=shop";</script>'; 
				}else{ 
					$this->check_user(); } } 
		}else{ if(in_array($this->m, $shop_module_arr)){ 
			$this->check_shop(); 
		}else{ $this->check_user(); 
		} } } } 
		function check_user(){ 
			$suid = @$_SESSION['user']['uid'];
			if(empty($suid) || !$suid){ if( ($this->m == 'account' && $this->a == 'pay_notice') || ($this->m == 'account' && $this->a == 'pay') || ($this->m == 'xuq' && $this->a == 'edit') || ($this->m == 'address' && $this->a == 'edit') || ($this->m == 'xuq' && $this->a == 'edit_save') || ($this->m == 'address' && $this->a == 'edit_save') ){ }else{ 
				echo '<script>location.href="member.php?a=login";</script>'; } } } 
				function check_shop(){ if(!empty($_SESSION['shop']['spid'])){ 
					if($_SESSION['shop']['status'] == '0'){ 
						exit('店铺关闭，请联系管理员'); } 
						if(empty($_SESSION['shop']['name'])){ 
							if((($this->m == 'shop') && ($this->a == 'base')) || (($this->m == 'shop') && ($this->a == 'base_save')) ){ }else{ 
								showmsg('请完善基本信息','member.php?m=shop&a=base'); } } }else{ showmsg('店铺未登录', 'member.php?a=login'); } } }